package com.example.sonone.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Profile;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/* ━━━━━━佛祖保佑━━━━━━
 *                  ,;,,;
 *                ,;;'(    社
 *      __      ,;;' ' \   会
 *   /'  '\'~~'~' \ /'\.)  主
 * ,;(      )    /  |.     义
 *,;' \    /-.,,(   ) \    码
 *     ) /       ) / )|    农
 *     ||        ||  \)
 *     (_\       (_\
 * ━━━━━━永无BUG━━━━━━
 * @author ：zjq
 * @date ：2020/7/5 0:16
 * @description: TODO
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 */
@RestController
@RequestMapping("file")
@Slf4j
public class FileController {




    @RequestMapping("log")
    public void log() throws InterruptedException {
        // 同步
        while (true){
            log.debug("当前时间debug:{}",System.currentTimeMillis());
            log.info("当前时间info:{}",System.currentTimeMillis());
            log.warn("当前时间warn:{}",System.currentTimeMillis());
            log.error("当前时间error:{}",System.currentTimeMillis());
            Thread.sleep(100);
        }



    }

    /**
     * 通用照片 上传模板
     */
    @RequestMapping("aa/{a}")
    public void uploadAppeal(@RequestParam Map<String, Object> params, @RequestParam("file") MultipartFile file,@PathVariable("a") int a  ) {

        System.out.println(1/a);
        System.out.println(file.getOriginalFilename());
        System.out.println(file.getSize());


    }
}
